﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Se.Extend
{
    public static class ExtendString
    {
        /// <summary>
        /// 首字母大写
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static string ToUpperFirst(this string str)
        {
            if (string.IsNullOrEmpty(str)) return str;

            return char.ToUpper(str[0]) + str.Substring(1);
        }

        /// <summary>
        /// 首字母小写
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static string ToLowerFirst(this string str)
        {
            if (string.IsNullOrEmpty(str)) return str;

            return char.ToLower(str[0]) + str.Substring(1);

        }
    }
}
